package com.ysh.smartplatform.controller;

import com.ysh.smartplatform.dto.R;
import com.ysh.smartplatform.pojo.Operlog;
import com.ysh.smartplatform.service.OperLogService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.Past;

/**
 * 袁胜虎 on 2022/9/16 10:35
 */
@RestController
@RequestMapping("/opers")
@Api(tags = "方法日志管理")
public class OperLogController {
    private OperLogService operLogService;

    @Autowired
    public void setOperLogService(OperLogService operLogService) {
        this.operLogService = operLogService;
    }
    @DeleteMapping("/oper/{operId}")
    private R deleteById(@PathVariable Long operId){
        operLogService.deleteById(operId);
        return R.OK();
    }

    @GetMapping("/oper/{operId}")
    private R selectById( @PathVariable  Long operId){
        operLogService.selectById(operId);
        return R.OK();
    }

    @PostMapping("/oper")
    private R updateOper(@RequestBody  Operlog operlog){
        operLogService.updateOper(operlog);
        return R.OK();
    }
}
